/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.booksku.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import cn.edu.pku.wxlib.booksku.model.*;
import cn.edu.pku.wxlib.booksku.service.*;
import cn.edu.pku.wxlib.booksku.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */


public class Booksku extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Booksku";
	public static final String ALIAS_BOOK_SKUID = "bookSkuid";
	public static final String ALIAS_BOOK_ID = "图书ID";
	public static final String ALIAS_CREATE_TIME = "createTime";
	public static final String ALIAS_SHELF_ID = "书架ID";
	public static final String ALIAS_STATE = "1非外借，2在架，3在借，4续借，5已预约，6下架，7报废，8丢失";
	public static final String ALIAS_BOOK_BORROW_TYPE_ID = "图书借阅类型ID";
	public static final String ALIAS_BAR_CODE = "预留条形码";

	//date formats
	public static final String FORMAT_CREATE_TIME = DATE_FORMAT;
	
	//columns START
    /** bookSkuid       db_column: bookSKUId */	
	
	private java.lang.Integer bookSkuid;
    /** 图书ID       db_column: bookId */	
	@NotNull 
	private java.lang.Integer bookId;
    /** createTime       db_column: createTime */	
	
	private java.util.Date createTime;
    /** 书架ID       db_column: shelfId */	
	
	private java.lang.Integer shelfId;
    /** 1非外借，2在架，3在借，4续借，5已预约，6下架，7报废，9丢失 db_column: state */	
	
	private java.lang.Integer state;
    /** 图书借阅类型ID       db_column: bookBorrowTypeId */	
	
	private java.lang.Integer bookBorrowTypeId;
    /** 预留条形码       db_column: barCode */	
	@Length(max=13)
	private java.lang.String barCode;
	//columns END

	public Booksku(){
	}

	public Booksku(
		java.lang.Integer bookSkuid
	){
		this.bookSkuid = bookSkuid;
	}

	public void setBookSkuid(java.lang.Integer value) {
		this.bookSkuid = value;
	}
	
	public java.lang.Integer getBookSkuid() {
		return this.bookSkuid;
	}
	public void setBookId(java.lang.Integer value) {
		this.bookId = value;
	}
	
	public java.lang.Integer getBookId() {
		return this.bookId;
	}
	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_CREATE_TIME);
	}
	public void setCreateTimeString(String value) {
		setCreateTime(DateConvertUtils.parse(value, FORMAT_CREATE_TIME,java.util.Date.class));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	public void setShelfId(java.lang.Integer value) {
		this.shelfId = value;
	}
	
	public java.lang.Integer getShelfId() {
		return this.shelfId;
	}
	public void setState(java.lang.Integer value) {
		this.state = value;
	}
	
	public java.lang.Integer getState() {
		return this.state;
	}
	public void setBookBorrowTypeId(java.lang.Integer value) {
		this.bookBorrowTypeId = value;
	}
	
	public java.lang.Integer getBookBorrowTypeId() {
		return this.bookBorrowTypeId;
	}
	public void setBarCode(java.lang.String value) {
		this.barCode = value;
	}
	
	public java.lang.String getBarCode() {
		return this.barCode;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("BookSkuid",getBookSkuid())
			.append("BookId",getBookId())
			.append("CreateTime",getCreateTime())
			.append("ShelfId",getShelfId())
			.append("State",getState())
			.append("BookBorrowTypeId",getBookBorrowTypeId())
			.append("BarCode",getBarCode())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getBookSkuid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Booksku == false) return false;
		if(this == obj) return true;
		Booksku other = (Booksku)obj;
		return new EqualsBuilder()
			.append(getBookSkuid(),other.getBookSkuid())
			.isEquals();
	}
}

